package com.example.springbooksystem.service;

import com.example.springbooksystem.mapper.UserMapper;
import com.example.springbooksystem.model.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-01-25
 * @time: 13:29:19
 */
@Service
@Slf4j
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public UserInfo queryUserByName(String name) {
        try {
            return userMapper.selectUserByName(name);
        } catch (Exception e) {
            log.error("通过名字查询用户信息失败, name{}",name);
            return null;
        }

    }
}
